#!/usr/bin/env python3
# -*- coding: utf-8 -*-

""" 文件描述内容 """

__auther__ = 'igofishing'


import numpy as np
from matplotlib import pyplot as plt

n = 12

X = np.arange(n)

Y1 = (1 - X/float(n)) * np.random.uniform(0.5, 1, n)
Y2 = (1 - X/float(n)) * np.random.uniform(0.5, 1, n)


# 设置柱状图
plt.bar(X, +Y1, facecolor='#38af43')
plt.bar(X, -Y2, facecolor='#666666')

# 在柱状图上添加值
for x, y in zip(X, Y1):
    plt.text(x+0.03, y+0.02, '%.2f' % y, ha='center', va='bottom')

for x, y in zip(X, Y2):
    plt.text(x-0.03, -y-0.08, '%.2f' % y, ha='center', va='bottom')

plt.xlim(-.5, n)

plt.show()
